home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / !Help < prev    next >
Text File  |  1995-08-28  |  18KB  |  565 lines

  1.     !DLSources - DeskLib Sources application directory
  2.     ••••••••••••••••••••••••••••••••••••••••••••••••••
  3.  
  4.  
  5. This application directory contains all DeskLib code-files except for
  6. the final libraries and headers, which are in the !DeskLib application.
  7. It sets the system variable <DeskLib_Sources$Dir> to be the !DLSources
  8. directory.
  9.  
  10. This directory is *not* needed for writing applications which use
  11. DeskLib - the !DeskLib application contains all the headers and
  12. libraries needed. All source code for DeskLib is contained in this
  13. directory.
  14.  
  15. The structure of this directory is rather different from previous
  16. DeskLib releases. This is partly because I've attempted to automate the
  17. creation of the various files needed for DeskLib, and because DeskLib is
  18. now available in DLL form, as well as the original statically-linkable
  19. 'DeskLib:o.DeskLib'. Code for DLLs has to be compiled with different
  20. flags from normal, so each DeskLib sublibrary now has two or three
  21. subdirectories contining differently-compiled .o files.
  22.  
  23. In the 'Scripts' subdirectory, there are a few Obey files which can be
  24. used to do various things such as generate makefiles for each
  25. sub-library. See below for a description of what each one does.
  26.  
  27. Please note that the version of the 'LibFile' program that comes with
  28. Acorn's Desktop C can crash the whole system very nastily if there isn't
  29. enough memory (it trashed my HD's boot block in doing so once). It seems
  30. to grab 1.5Mb if possible, so the scripts which actually call LibFile
  31. have a 'Wimpslot 1500k' to ensure there is enough space for LibFile to
  32. work in. This seems to be enough memory to build DeskLib at least.
  33.  
  34. All of the scripts are of type 'TaskObey' so run in a taskwindow if
  35. double clicked. This probably slows down compiling, but I prefer to keep
  36. my system multitasking where possible. Everything should work fine if
  37. you settype them to be vanilla Obey files.
  38.  
  39. The 'Bin' directory contains a few of programs which I use to do various
  40. things sycj as create makefiles in each DeskLib sublibrary directory.
  41.  
  42. The 'Libraries' directory contains, as before, a separate directory for
  43. each DeskLib sub-library. Each has two or three makefiles which make the
  44. various files. These makefiles are now created automatically using
  45. template makefiles in the 'TemplateMF' directory.
  46.  
  47.  
  48.  
  49. Remaking DeskLib
  50. ————————————————
  51.  
  52. This should be fairly straightforward:
  53.  
  54. The file '!DLSources.Scripts.Static.MakeAll' will remake those parts of
  55. the static version of DeskLib that are out of date, by running Amu on
  56. each library's makefile.
  57.  
  58. The file '!DLSources.Scripts.Static.MakeAll2' is more drastic - it
  59. deletes all the .o files, retrims the header files, remakes all the
  60. makefiles from the template makefiles in '!DLSources.TemplateMF', and
  61. then recompiles everything.
  62.  
  63. The files '!DLSources.Scripts.Static+DLL.MakeAll' and
  64. '!DLSources.Scripts.Static+DLL.MakeAll2' are similar to the above,
  65. except that they also remake the dynamic-linking version of DeskLib.
  66.  
  67. The file '!DLSources.Scripts.OtherLibs.MakeAll' remakes the libraries
  68. which aren't part of the main DeskLib library - Debug and SmallError.
  69.  
  70.  
  71.  
  72.  
  73. Dynamically Linked DeskLib sublibraries
  74. ———————————————————————————————————————
  75.  
  76. When making a client for use with DeskLib DLLs, link with
  77. 'DeskLib:o.DLLClient' (instead of 'DeskLib:o.DeskLib'). This file
  78. contains the stubs files of all DeskLib sublibraries available as DLLs,
  79. and suitably-compiled .o files from all the other sublibraries (for full
  80. information about making DLL clients, see
  81. '...Docs.DynamLink.SDLS_Apps').
  82.  
  83. This ensures that, when making a client to use DLL DeskLib, code for
  84. DeskLib functions not available as a DLL is linked in statically.
  85.  
  86. Only about half of the DeskLib sublibraries have DLL versions. This is
  87. because it is not practical to make a DLL version of (say) WimpSWIs -
  88. for example, just one call to a Wimp SWI would involve loading the
  89. entire 5k WimpSWIs DLL into the RMA. Instead, the call is statically
  90. linked into the client. This is generally true for any DeskLib
  91. sublibrary which consists of many small unrelated functions.
  92.  
  93. There is also what appears to be a 1.2k overhead when making a DLL, so
  94. very small DeskLib sublibraries (eg Sound) are also not available as
  95. DLLs.
  96.  
  97.  
  98.  
  99. Other
  100. —————
  101.  
  102. To enable auto-generation of appropriate makefiles for the sublibraries
  103. and auto-generation of the final DeskLib libraries, sub-libraies which
  104. are available as DLLs have a zero-length 'IsDLL' file in their
  105. directory.
  106.  
  107. Code for use in a DLL has to be compiled with various special cc flags,
  108. so every DeskLib sublibrary which has a DLL version has two different
  109. sets of .o files. These are in '<sublibname>.DLL' and
  110. '<sublibname>.Static'.
  111.  
  112. In addition, every sublibrary which is not available as a DLL has three
  113. sets of .o files - for static linking, static linking with a DLL client,
  114. and static linking with a DLL.
  115.  
  116.  
  117.  
  118.  
  119.  
  120. Fairly complete description of all files in this !DLSources directory
  121. —————————————————————————————————————————————————————————————————————
  122.  
  123. Here is what is where:
  124.  
  125.  
  126. !Boot        Sets the system variable DeskLib_Source$Dir to point to
  127.         this directory. Also sets DeskLib_Run$Path to point to the
  128.         Bin subdirectory, and adds DeskLib_Run: to your
  129.         Run$Path.
  130.         Sets 'DeskLib_Commands:' to point to
  131.         '!DLSources.Scripts.Commands.'.
  132.  
  133. !Run        Simply runs !Boot.
  134.  
  135. !Help        This file.
  136.  
  137. !Sprites    The !DLSources sprite - a green version of the normal
  138.         DeskLib sprite.
  139.  
  140. Bin.        Some general utilities used by some of the scripts described
  141.         below. They might be useful for non-DeskLib things as well.
  142.         This 'Bin' directory is added to Run$Path.
  143.     
  144.     Every        Runs a command on every file/dir in a directory.
  145.             Just type 'Every' to get help.
  146.     
  147.     CTrim        Strips comments from a C source file. Only
  148.             overwrites the destination file if the new file
  149.             differs. This is to allow modification of
  150.             comments in h_doc headers, without forcing
  151.             recompilation of hundreds of C files.
  152.         
  153.     TrimCRs        Removes all CR characters from a file. 
  154.     
  155.     Makatic        Used to make makefiles suitable for a particular 
  156.             project directory, using a template makefile.
  157.     
  158.     IfExist        Runs a command only of the specified file/dir
  159.             exists.
  160.     
  161.     IfNotExist    Runs a command only of the specified file/dir
  162.             doesn't exist.
  163.  
  164.     
  165.  
  166. Libraries.    Every DeskLib sub-library's source, makefiles etc.
  167.     
  168.     <Lib-name>.
  169.         
  170.         Every sublibrary has the following
  171.         source-directories:
  172.         
  173.         c.    C source
  174.         s.    Assembler source
  175.         h.    Internal headers 
  176.         
  177.         Every library also has the following directory:
  178.  
  179.         Static.        All files for the conventional version
  180.                 of this sublibrary.
  181.                     
  182.             Makefile    The makefile
  183.             
  184.             Lib        One-chr long file which has the
  185.                     date-stamp of the last creation
  186.                     date of this library.
  187.                 
  188.             o.        The .o files.
  189.         
  190.                     
  191.         DeskLib sublibraries which are not available as a DLLs
  192.         ——————————————————————————————————————————————————————
  193.     
  194.         As well as the normal static .o files described above,
  195.         there are two extra sets of .o files, in 'DLLClient' 
  196.         and 'DLL':
  197.         
  198.     <Lib-name>.DLLClient.    All files needed when statically
  199.                 linking this sublibrary with a 
  200.                 client application.
  201.                 The .o files are compiled with
  202.                 _DeskLib_SDLS_CLIENT predefined.
  203.             
  204.             MkClientOs    This makefile compiles the
  205.                     source with _DeskLib_SDLS_CLIENT
  206.                     predefined.
  207.             
  208.             o.        The .o files.
  209.         
  210.         
  211.         DLL.        All files needed when statically
  212.                 linking this sublibrary with a 
  213.                 DLL.
  214.             
  215.             MkOs        Compiles the source with cc -zM
  216.                     etc.
  217.             
  218.             o.        The object files.
  219.         
  220.         
  221.         
  222.         DeskLib sublibraries which are available as a DLLs
  223.         ——————————————————————————————————————————————————
  224.         
  225.         As well as the normal static .o files described above,
  226.         there is one extra set of .o files in 'DLL' plus a few 
  227.         extra files which are needed to make the DLL version.
  228.         
  229.     <Lib-name>.DLL.        Everything for making this
  230.                 sublibrary into a DLL.
  231.                 
  232.             o.    Object code compiled
  233.                 with special flags
  234.                 for use in SDLS DLLs:
  235.                 -zM
  236.                 -D_DLL
  237.                 etc.
  238.             
  239.             MakeStubsOs
  240.                 This makefile compiles
  241.                 all the .c files and
  242.                 makes the DLL Stubs file.
  243.                             
  244.             PlainStubs
  245.                 Plain stubs file as created
  246.                 using SDLS's 'cdll' tool.
  247.                 
  248.             OSObj    An extra .o file which 
  249.                 imports symbols from every
  250.                 Stubs file that this sublibrary
  251.                 references. This is an assembled
  252.                 version of 'OtherStubs' 
  253.                 described below.
  254.                 
  255.             Stubs    The Stubs file for this
  256.                 sublibrary. This is simply the
  257.                 'PlainStubs' and 'OSObj' object
  258.                 files partially linked together.
  259.             
  260.             MakeDLL    This makefile makes the DLL
  261.                 by linking all the .o
  262.                 files with 'Header',
  263.                 DeskLib:o.DLLDLL and a
  264.                 few .o files which come
  265.                 with the SDLS.
  266.             
  267.             Header    Intermediate file used
  268.                 to make the 'DLL' file.
  269.         
  270.         
  271.         These are a few extra files in DLL library directories.
  272.         
  273.         OtherStubs
  274.             Small assembler source. Only
  275.             used when making DLL Stubs
  276.             files. See
  277.             '!DLSources.Docs.RndDLLInfo' for
  278.             more information about this.
  279.         
  280.         
  281.         DLLDef    (Libraries.DLL.*. only)
  282.         
  283.             Text file which specifies what functions the DLL
  284.             provides. If this is not present, the DLL 
  285.             makefile will use cdll to make a default one based 
  286.             on what .o files are present, but this will need 
  287.             modifying by hand.
  288.             
  289.             NB the DLLDef file is not in the 'DLL' directory 
  290.             because it is effectively a source file - it is
  291.             tweaked by hand after generation by cdll. Hence 
  292.             keeping it outside the 'DLL' directory means that 
  293.             one can delete all the 'DLL' directories to save on 
  294.             disc space but still be able to restore all DLL 
  295.             information easily.
  296.         
  297.         IsDLL    Zero-length file which is present only in
  298.             sub-libraries which are available as DLLs.
  299.             The presence/absence of this file is checked by
  300.             the various DeskLib scripts so that different
  301.             things are done to libraries which can/can't be 
  302.             made into DLLs.            
  303.                     
  304.  
  305.  
  306. OtherLibs.    A few libraries which aren't part of the main DeskLib
  307.         library-files.
  308.     
  309.     Debugs.        Some alternative debugging libraries
  310.     
  311.         Makefile    This puts the different debugging
  312.                 libraries into <DeskLib$Dir>.o.Debug.
  313.         o.
  314.         c.
  315.     
  316.     SmallError.    An alternative to the standard Error library.
  317.             It sends error messages to stderr. Useful for
  318.             using Error_Report* in command line programs.
  319.             The generated library is 
  320.             '<DeskLib>.Other.SmError'.
  321.  
  322.  
  323. TemplateMF.    Contains template makefiles for making static and
  324.         dynamically-linked versions of the DeskLib sublibraries.
  325.         These makefiles just need the macro $(ObjectFiles) to
  326.         be set to be a space-separated list of .o files, and 
  327.         $(LibName) to be set to the name of the library, and 
  328.         they will compile/assemble etc as necessary.
  329.         The 'Makatic' command is used to generate real usable
  330.         makefiles from these templates in each of the 
  331.         sub-library directories.
  332.     
  333.     Static        Produces standard .o files
  334.     
  335.     MakeDLL        Links .o files with the DeskLib:o.DLLDLL library
  336.             to make the finished DLL.
  337.     
  338.     MkStubsOs    Compiles all .c/s files with flags suitable for
  339.             making into a DLL.
  340.             Uses cdll to make a stubs file.
  341.             Uses cdll to generate a default Defs file if
  342.             none is present.
  343.     
  344.     MkOs        Compiles all .c/s files with flags suitable for
  345.             linking statically with a DLL.  Used for libraries 
  346.             which aren't available as a DLL.
  347.     
  348.     MkClientOs    Makes .o files suitable for static linking with
  349.             a client application. Used for libraries which
  350.             aren't available as a DLL.
  351.  
  352.  
  353. ObjLists.    Various text files which contain lists of .o
  354.         files for use with LibFile to make the finished DeskLib
  355.         libraries.
  356.         
  357.         Note that these lists are generated automatically by
  358.         scripts before LibFile is called, so that they are
  359.         always up to date. They take a few minutes to generate
  360.         at the moment, because they use a rather clumsy system 
  361.         of calling Obey file CLI commands.
  362.         
  363.     DLLDLL        List of all Stubs files, and all .o files
  364.             from non-DLL sublibraries compiled for use in
  365.             DLLs.
  366.             ie.
  367.             <DeskLib_Sources$Dir>.Libraries.DLL.*.DLL.Stubs
  368.             <DeskLib_Sources$Dir>.Libraries.Static.*.DLL.o.*
  369.     
  370.     Static        List of all .o files compiled conventionally for 
  371.             use in the standard DeskLib library.
  372.             ie.
  373.             <DeskLib_Sources$Dir>.Libraries.Static.*.Static.o.*
  374.             <DeskLib_Sources$Dir>.Libraries.DLL.*.Static.o.*
  375.     
  376.     DLLClient    List of all Stubs files, and all .o files
  377.             from non-DLL sublibraries compiled for use in
  378.             clients.
  379.             ie.
  380.             <DeskLib_Sources$Dir>.Libraries.DLL.*.DLL.Stubs
  381.             <DeskLib_Sources$Dir>.Libraries.Static.*.Static.o.*
  382.  
  383.  
  384. Scripts.    Some TaskObey files which do various things such as
  385.         generate makefiles, run makefiles etc. NB a TaskObey
  386.         file is the same as a normal obey file, except it runs
  387.         in a taskwindow when double-clicked.
  388.         
  389.         
  390.     Static+DLL.    These scripts make both the static and DLL parts of
  391.             DeskLib
  392.         
  393.  
  394.         MakeAll        Does everything needed to make
  395.                 the three DeskLib library files.
  396.     
  397.         MakeLibs    Does all the LibFile-ing needed to completely
  398.                 remake DeskLib. Useful if a library is changed 
  399.                 - just run the library's makefiles and then 
  400.                 run this script. This saves running every 
  401.                 makefile as done by MakeAll.
  402.         
  403.         CleanC        Removes all C .o files.
  404.         
  405.         Clean        Removes all .o files.
  406.         
  407.         MakeMFs        Remakes every makefile in the sublibraries.
  408.         
  409.         MakeAll2    This *completely* remakes DeskLib - new makefiles,
  410.                 trims the DeskLib headers, deletes all .o files
  411.                 and recompiles etc.
  412.     
  413.     
  414.     Commands.    Some general DeskLib-specific commands.
  415.             These are accessed with (for eg.)
  416.             DeskLib_Commands:EachStatic ...
  417.         
  418.         EachStatic    'EachStatic <command>' runs <command> on 
  419.                 every static-only DeskLib sublibrary. Any
  420.                 occurrence of '%0' is replaced by the 
  421.                 complete dirname of the sublibrary, while
  422.                 '%1' is replaced by the leafname of the
  423.                 sublibrary (ie the sublibrary name).
  424.                 This uses 'Every' and 'IfNotExist'.
  425.         
  426.         EachDLL        As above, except <command> is run on each
  427.                 DLL-sublibrary.
  428.         
  429.         EachLib        As above, except <command> is run on all
  430.                 DeskLib's sublibraries, both static and DLL.
  431.         
  432.         EachUser    As above, except <command> is run on all
  433.                 the libraries in '!DLUser'.
  434.     
  435.         Append        'Append <file> <text>' appends '|<text>' 
  436.                 to <file>
  437.         
  438.     
  439.     
  440.  
  441.     
  442.     
  443.     Static.        All the scripts to do with making the static DeskLib
  444.             DeskLib:o.DeskLib
  445.         
  446.         MakeAll        This makes the entire static version of
  447.                 DeskLib, 'DeskLib:o.DeskLib'.
  448.                 It first runs RunStaMFs, then runs MakeLib.
  449.         
  450.         MakeOList    Makes ObjLists.Static, a list of all .o 
  451.                 files compiled for the static version of
  452.                 DeskLib
  453.     
  454.         MakeStaMFs    Makes a makefile in each sublibrary
  455.                 directory. The makefile makes each 
  456.                 .c/s file into a .o suitable for the
  457.                 static version of DeskLib.
  458.         
  459.         RunStaMFs    This runs AMU on each makefile created by
  460.                 the above MakeStaMFs.
  461.         
  462.         MakeLib        Runs MkOList to generate the file
  463.                 ObjLists.Static, and then uses LibFile to 
  464.                 merge all .o files into DeskLib:o.DeskLib.
  465.         
  466.         CleanC        Deletes every .Static.o.* file which was
  467.                 made from a .c file.
  468.         
  469.         Clean        Deletes every .Static.o.* file.
  470.         
  471.         MakeAll2    This *completely* remakes the static DeskLib
  472.                 library - new makefiles, trims the headers,
  473.                 deletes all static .o files and recompiles
  474.                 them, and then calls LibFiles to make
  475.                 DeskLib:o.DeskLib .
  476.                 Note that the DLL DeskLib is not updated.
  477.         
  478.         CleanMake    Deletes all static .o files and recompiles, 
  479.                 and then remakes DeskLib:o.DeskLib .
  480.  
  481.  
  482.     DLL.        All the scripts to do with making the DLL DeskLib.
  483.     
  484.         CleanDLLC    Deletes all .o files that came from .c files.
  485.         
  486.         CleanDLLOb    Deletes all non .o object files - Stubs, 
  487.                 PlainStubs, OSObj and Header. I used this when 
  488.                 a new version of the SDLS came out.
  489.  
  490.         CopySObjs    Copies every .o file that came from
  491.                 assembling a .s file in the 'Static'
  492.                 subdirectory, into the .o directory of
  493.                 the 'DLL' subdirectory.
  494.         
  495.         MakeAll        This makes the two DLL-DeskLibs
  496.                 DeskLib:o.DLLDLL and DeskLib:o.DLLClient
  497.                 It first runs RunSubsOs, then MakeDLibs,
  498.                 then RunDLL, then MoveDLLs.
  499.         
  500.         MkDCList    Generates the 'ObjLists.DLLClient' file
  501.                 - all DLL Stubs files plus all .o files
  502.                 from non-DLL sublibraries compiled for
  503.                 linking with *clients*.
  504.         
  505.         MkDDList    Generates the 'ObjLists.DLLDLL' file -
  506.                 all DLL Stubs files plus all .o files
  507.                 from non-DLL sublibraries compiled for
  508.                 linking with *DLLs*.
  509.         
  510.         MakeDLibs    Makes the two libraries needed for DLL client
  511.                 and the actual SDLS libraries.
  512.     
  513.     
  514.         MakeTree    Makes all the subdirs and makefiles for a DLL 
  515.                 sublibrary.
  516.         
  517.         
  518.         -- Scripts for making makefiles --
  519.         
  520.         MakeDLL        Uses Makatic to generate a makesfile in each 
  521.                 DLL sublibrary directory which makes the DLL.
  522.                 Each makefile is based on 'TemplateMF.MakeDLL'
  523.         
  524.         MakeStbsOs    Uses Makatic to make a makefile in each DLL
  525.                 sublibrary directory which makes all .o files
  526.                 for that library and also makes the Stubs 
  527.                 file for that sublibrary. Each makefile is based
  528.                 on TemplateMF.MakeStubsOs
  529.                 Also makes the MakeOs makefile in each non-DLL
  530.                 sublibrary, whch makes all .o files suitable for
  531.                 linking with a DLL.
  532.         
  533.         MkClientOs    Uses Makatic to make a makefile in each 
  534.                 static-sublibrary. This makefile will make .o
  535.                 files suitable for static linking with client
  536.                 applications.
  537.         
  538.         MakeAllMFs    Calls all three of the above files.
  539.         
  540.         
  541.         -- Scripts for running makefiles --
  542.         
  543.         RunClientO    Runs each <libname>.DLLClient.MkClientOs makefile.
  544.  
  545.         RunDLL        Runs the 'MakeDLL' makefiles in each DLL-library.
  546.         
  547.         RunStubOs    Runs each of the MakeDLL makefiles.
  548.     
  549.     
  550.     OtherLibs    Scripts for making the extra libraries that aren't 
  551.             included in the main 'DeskLib:o.DeskLib' library
  552.             (eg Debug and SmallError).
  553.         
  554.         MakeAll    Runs amu on the makefile within each directory in 
  555.             '!DLSources.OtherLibs'.
  556.         
  557.         Clean    Deletes all .o files within 
  558.             '!DLSources.Scripts.OtherLibs'.
  559.  
  560.  
  561.  
  562.  
  563.  
  564. - Julian Smith
  565.